from frontend.roleApplication import RoleApplication
from frontend.form import Type

class Manager(RoleApplication):
    
    def __init__(self):
        super(Manager, self).__init__("Restock2", "Manager") 
        self.register_source_step("Examine", self.Start_Examination)
        self.register_transition_step("Replacement", self.Start_Replacement)
    
    def Start_Examination(self, stepname, form):
        form.add_static_label('Please Complete an examination of the store')
        form.add_static_label('Do any items need to be re-stocked? ')
        form.add_field(Type.BOOLEAN, 'stockneeded')
        form.add_static_label('List the style, size and color of the item that must be re-stocked')
        form.add_field(Type.SHORTSTRING, "ItemNumber")
        form.add_field(Type.SHORTSTRING, "Size")
        form.add_field(Type.SHORTSTRING, "Color")

    def Start_Replacement(self, stepname, form):
        form.add_task_label(fields=["ItemNumber", "Size", "Color"]);
        form.add_static_label('Your employee has indicated that the above item is not available')
        form.add_static_label('Please select a new item')
        form.add_field(Type.SHORTSTRING, "NewItemNumber")
        form.add_field(Type.SHORTSTRING, "NewSize")
        form.add_field(Type.SHORTSTRING, "NewColor")
    
if __name__ == '__main__':
    app = Manager()
    app.MainLoop()